package org.yylnb.openplatform.commons.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * @author RainLin
 * @date 2020/8/1 - 10:56
 */
public class LoggerBean {
    //应用的app_key
    private String app_key;
    //请求的接口的名字 也就是method
    private String apiName;
    //来自于哪个客户端
    private String remoteIP;
    //哪个网关接收的消息
    private String serverIp;
    //收到请求的时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date receiveTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //返回结果的时间
    private Date responseTime;
    //总响应时间
    private long totleTime;
    //传递的其他的内容
    private String content;

    public String getApp_key() {
        return app_key;
    }

    public void setApp_key(String app_key) {
        this.app_key = app_key;
    }

    public String getApiName() {
        return apiName;
    }

    public void setApiName(String apiName) {
        this.apiName = apiName;
    }

    public String getRemoteIP() {
        return remoteIP;
    }

    public void setRemoteIP(String remoteIP) {
        this.remoteIP = remoteIP;
    }

    public String getServerIp() {
        return serverIp;
    }

    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }


    public Date getResponseTime() {
        return responseTime;
    }

    public void setResponseTime(Date responseTime) {
        this.responseTime = responseTime;
    }

    public long getTotleTime() {
        return responseTime.getTime() - receiveTime.getTime();
    }

    public void setTotleTime(long totleTime) {
        this.totleTime = totleTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

}
